import Home from '@/views/home.vue'
import Index from '@/views/index.vue'
import Login from '@/views/login.vue'
import My from '@/views/my.vue'
import Register from '@/views/register.vue'
import Search from '@/views/search.vue'
import Shop from '@/views/shop.vue'
import { createRouter, createWebHistory } from 'vue-router'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/login',
      component: Login,
    },
    {
      path: '/register',
      component: Register,
    },
    {
      path: '/search',
      component: Search,
    },
    {
      path: '/index',
      component: Index,
      children: [
        {
          path: '/home',
          component: Home,
        },
        {
          path: '/my',
          component: My,
        },
        {
          path: '/shop',
          component: Shop,
        },
      ]
    }
  ],
})

export default router
